
<?php
include('./libs/Smarty.class.php');
echo "pass a parameter and maybe the flag file's filename is random :>";
$smarty = new Smarty();
if ($_GET) {
    highlight_file('index.php');
    foreach ($_GET as $key => $value) {
        print $key . "\n";
        if (preg_match("/flag|\/flag/i", $value)) {
            $smarty->display('./template.html');
        } elseif (preg_match("/system|readfile|gz|exec|eval|cat|assert|file|fgets/i", $value)) {
            $smarty->display('./template.html');
        } else {
            $smarty->display("eval:" . $value);
        }
    }
}
?>